package com.qf.service.impl;

import com.qf.entity.Order;
import com.qf.entity.OrderDTO;
import com.qf.mapper.OrderMapper;
import com.qf.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * 天--道--酬--勤
 *
 * @author LiangGaoQiang
 * @ClassName OrderServiceImpl
 * @Date: 2025/4/28 下午4:37
 * @Description: 描述
 */

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderMapper orderMapper;

    /**
     * 订单的分页查询
     * @param orderDTO 前端传递的订单对象
     * @return 分页查询的结果列表
     */
    @Override
    public List<Order> fuzzyQueryOrder(OrderDTO orderDTO) {
        return orderMapper.fuzzyQueryOrder(orderDTO);
    }

    /**
     * 订单的新增
     * @param order 新增的订单对象
     * @return 是否新增成功
     */
    @Override
    public boolean addOrder(Order order) {
        return orderMapper.addOrder(order);
    }

    /**
     * 订单的修改
     * @param order 修改的订单对象
     * @return 是否修改成功
     */
    @Override
    public boolean updateOrder(Order order) {
        return orderMapper.updateOrder(order);
    }

    /**
     * 订单的删除
     * @param id 订单id
     * @return 是否删除成功
     */
    @Override
    public boolean deleteOrderById(Long id) {
        return orderMapper.deleteOrderById(id);
    }

    /**
     * 订单的批量删除
     *
     * @param ids 订单id列表
     * @return 是否批量删除成功
     */
    @Override
    public boolean deleteBatchOrderById(List<Long> ids) {
        return orderMapper.deleteBatchOrderById(ids);
    }
}
